package com.mariusz.ui.models;

import java.util.List;

import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;

import com.mariusz.data.dto.Property;
import com.mariusz.data.dto.Room;

public class RoomListModel extends AbstractListModel implements ComboBoxModel  {
	private List<Room> rooms;
	private Object selected;
	
	public RoomListModel(List<Room> rooms){
		super();
		this.rooms = rooms;
	}
	
	@Override
	public Object getElementAt(int index) {
		
		return rooms.get(index);
	}

	@Override
	public int getSize() {

		return rooms.size();
	}

	@Override
	public Object getSelectedItem() {
		
		return selected;
	}

	@Override
	public void setSelectedItem(Object anItem) {
		selected = anItem;
		
	}

}
